package com.tanx.jpa;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Entity
@Data
public class FaceRecognitionRecord {
    @Id
    private String uuid = "123";
    @Column
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDateTime = new Date();
    @Column
    private String jobNumbers;
    @Column
    private String path;

    public FaceRecognitionRecord(String jobNumbers, String path) {
        this.jobNumbers = jobNumbers;
        this.path = path;
    }

    public FaceRecognitionRecord() {
    }

    public FaceRecognitionRecord(List<String> list, String path) {
        StringBuilder builder = new StringBuilder();
        for (String s : list) {
            builder.append(s).append(",");
        }
        if (builder.length() > 0) {
            builder.deleteCharAt(builder.length() - 1);
        }
        jobNumbers = builder.toString();
        this.path = path;
    }
}
